import { pubRequire } from '@utils/public'
const baseUrl = '/lifes/reviews'
// 获取列表
export function getSearchList(params, callBack, errBack) {
  return pubRequire('get', `${baseUrl}/comments/`, params, callBack, errBack)
}
// 通过单个
export function passSingleAPI(id, callBack, errBack) {
  return pubRequire(
    'put',
    `${baseUrl}/${id}/comments/pass`,
    '',
    callBack,
    errBack
  )
}
// 批量通过
export function passMultAPI(params, callBack, errBack) {
  return pubRequire(
    'put',
    `${baseUrl}/comments/pass`,
    params,
    callBack,
    errBack
  )
}
// 批量不通过
export function failMultRequestAPI(params, callBack, errBack) {
  return pubRequire(
    'put',
    `${baseUrl}/comments/unpass`,
    params,
    callBack,
    errBack
  )
}
// 不通过单个
export function failSingleRequestAPI(reviewsId, params, callBack, errBack) {
  return pubRequire(
    'put',
    `${baseUrl}/${reviewsId}/comments/unpass`,
    params,
    callBack,
    errBack
  )
}
// 置顶
export function toTopAPI(commentId, callBack, errBack) {
  return pubRequire('put', `/comments/${commentId}/top`, '', callBack, errBack)
}
// 取消置顶
export function cancelTopAPI(commentId, callBack, errBack) {
  return pubRequire(
    'put',
    `/comments/${commentId}/untop`,
    '',
    callBack,
    errBack
  )
}
// 加赞
export function addPraiseAPI(commentId, params, callBack, errBack) {
  return pubRequire(
    'post',
    `/comments/${commentId}/likes`,
    params,
    callBack,
    errBack
  )
}
